Skip to content

docs: add the Auto-fix API to the Gateway docs - #1150

Merged
ankur-mittal95 merged 20 commits into
mainfrom
docs/gateway-sanitize-api
Sep 11, 2026
Merged

docs: add the Auto-fix API to the Gateway docs#1150
ankur-mittal95 merged 20 commits into
mainfrom
docs/gateway-sanitize-api

Conversation

@ankur-mittal95

@ankur-mittal95 ankur-mittal95 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Why

The Gateway is getting a standalone endpoint that repairs invalid OpenUI Lang without routing the request through generation (thesysdev/muse#599, thesysdev/coda#1024). Users who call a model directly need to find it from the Gateway docs and know what it takes, returns, and costs.

The endpoint ships with thesysdev/muse#599 and thesysdev/coda#1024. Merge this once those are deployed, so the page never describes something that does not answer.

What changes

  • New page, Auto-fix API (gateway/api/auto-fix.mdx): endpoint, a complete example with the library spec import and the API key, the request fields, the three status values with a sample response for a fix and for a failed fix, the error codes with their meaning, limits, a pricing pointer, HTTP errors, and how calls appear in the console.
  • Introduction: a third card under "Choose an API" and one bullet under "What OpenUI Gateway provides".
  • Sidebar: Auto-fix API under APIs, after Conversations API.
  • Reliability: a "New: Auto-fix API" callout at the top of the page, the table row updated to mention it, and one line under "What your application still controls" about fallback when a repair fails.
  • Pricing: a short note under Gateway rates. Flat $0.02 per call that runs a fix, from Gateway Credits; a valid generation is free; no plan API call. The API page only links here.

Wording follows the existing pages: short sentences, the reader's side of the screen, and the same section order as the other API pages. The existing pages were edited in place without reformatting, since they are not prettier-formatted.

Check before merging

  • The sample responses were captured from a local run and match the contract in the muse PR.
  • Rendered locally on the docs dev server: intro cards, sidebar entry, the new page, the Reliability callout, and the Pricing note all display as intended.

🤖 Generated with Claude Code

Review round 1

Applied: no "program" anywhere (the API field is now generation on both sides); openUIlibraryVersion and customActions removed, library is the one input and takes openui.spec.json as the CLI writes it; full examples with imports; artifact limit line removed; "two attempts to fix the generation"; price stated only on the Pricing page.

Review round 2

Renamed the API from Sanitize to Auto-fix: page api/auto-fix.mdx, sidebar entry, card, callout, endpoint /v1/embed/auto-fix, console model name openui/auto-fix.

Conversation context

The Auto-fix API page also documents the optional messages field: the conversation that produced the generation, as { role, content } turns, used only to understand intent. Limits: 20 turns and 8,000 characters in total, oldest turns dropped first. Both code examples pass it, and the 400 row covers it. Pairs with muse #601 and coda #1026. (Folded in from #1162.)

Review round 3: the OpenAI chat shape, and the name loses its dash

The API is now the Autofix API, with no dash anywhere: the page is
gateway/api/autofix.mdx, the path is /v1/autofix, and the console model name
is openui/autofix. Every link and mention under docs/content follows.

The request and the answer are an OpenAI chat completion, so the page was
rewritten around that:

  • There are two entry points. POST https://api.thesys.dev/v1/autofix for a
    plain HTTP call, and https://api.thesys.dev/v1/autofix/chat/completions,
    which is where an OpenAI SDK posts when /v1/autofix is its base URL. Same
    body, same answer.
  • The primary example is the OpenAI Node SDK, with the cast the extra
    fix_summary field needs. A plain fetch example and a Python example
    follow.
  • The conversation is no longer a separate messages field beside a
    generation: messages is the request, and the generation is the last
    assistant turn. The Request table says so, and the 400 row covers it.
  • The answer section describes a chat completion: choices[0].message.content
    for the generation, fix_summary for status, fixed_errors and
    unfixed_errors.
  • Streaming is not supported, listed in the Request table and in the 400
    row.

Checked on the local docs server: /docs/gateway/api/autofix renders, and no
page under docs/content links to auto-fix any more.

New API page with the request, config, response statuses, error codes,
limits, pricing, and errors. A card on the Gateway introduction, a
sidebar entry under APIs, a callout on the Reliability page, and a
short Pricing note.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openui-docs Ready Ready Preview Sep 11, 2026 1:52pm UTC

Request Review

Comment thread docs/content/docs/gateway/api/sanitize.mdx Outdated
Comment thread docs/content/docs/gateway/api/sanitize.mdx Outdated
Comment thread docs/content/docs/gateway/api/sanitize.mdx Outdated
Comment thread docs/content/docs/gateway/api/sanitize.mdx Outdated
Comment thread docs/content/docs/gateway/api/sanitize.mdx Outdated
Comment thread docs/content/docs/gateway/api/sanitize.mdx Outdated
No "program" anywhere; one library input, taken from the CLI's spec
file, with full examples including imports; no artifact limit line;
pricing links to the Pricing page instead of stating the amount.
@ankur-mittal95 ankur-mittal95 changed the title docs: add the Sanitize API to the Gateway docs docs: add the Auto-fix API to the Gateway docs Sep 10, 2026
abhithesys
abhithesys previously approved these changes Sep 10, 2026
The production section now has two subsections: the Auto-fix API for
applications that call the model themselves, and OpenUI Gateway.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Ankur Mittal and others added 3 commits September 11, 2026 13:20
Review feedback: the page describes a standalone API.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The repair reads the conversation to keep what the user asked for, so the
page has to say the field exists, what the limits are, and where the text
goes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Review feedback on the conversation-context lines.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Comment thread docs/content/docs/gateway/api/auto-fix.mdx Outdated
Comment thread docs/content/docs/gateway/api/auto-fix.mdx Outdated
Comment thread docs/content/docs/gateway/api/auto-fix.mdx Outdated
Comment thread docs/content/docs/gateway/api/auto-fix.mdx Outdated
The page described a body of its own and the old `/v1/embed/auto-fix` path,
which no longer exists. The name loses its dash too.

The request is a chat completion whose last assistant turn carries the
generation to fix, so the first example is the OpenAI SDK with a base URL of
`/v1/autofix`. A plain fetch and a Python call follow. Streaming is listed as
not supported.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Ankur Mittal and others added 4 commits September 11, 2026 19:08
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@ankur-mittal95
ankur-mittal95 merged commit 8bd2e27 into main Sep 11, 2026
5 checks passed
@ankur-mittal95
ankur-mittal95 deleted the docs/gateway-sanitize-api branch September 11, 2026 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants